package com.android.systemui.ios.wall;

import android.content.Context;
import android.graphics.Outline;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.widget.ImageView;

public class IpCornerImageView extends ImageView {

    public IpCornerImageView(Context context) {
        super(context);
    }

    public IpCornerImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public IpCornerImageView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();

        setClipToOutline(true);
        setOutlineProvider(new ViewOutlineProvider() {

            @Override
            public void getOutline(View view, Outline outline) {
                outline.setRoundRect(1, 1, view.getWidth() - 1, view.getHeight() - 1, 26);
            }
        });
    }
}
